package ltd.hxya.novel.crawl.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author hty
 * @since 2022-10-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("crawl_rule")
@ApiModel(value="CrawlRule对象", description="")
public class CrawlRule implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "爬虫规则id")
    @TableId(value = "rule_id", type = IdType.AUTO)
    private Integer ruleId;

    @ApiModelProperty(value = "爬虫源id")
    private Integer sourceId;

    @ApiModelProperty(value = "爬虫网站地址")
    private String crawlUrl;

    @ApiModelProperty(value = "搜索url")
    private String searchHref;

    @ApiModelProperty(value = "小说url")
    private String bookHref;

    @ApiModelProperty(value = "小说内容url")
    private String bookContentHref;

    @ApiModelProperty(value = "目录爬取规则")
    private String indexPattern;

    @ApiModelProperty(value = "小说内容爬取规则")
    private String bookContentPattern;

    @ApiModelProperty(value = "小说封面爬取规则")
    private String bookImgPattern;

    @ApiModelProperty(value = "小说分类爬取规则")
    private String bookCategoryPattern;

    @ApiModelProperty(value = "小说介绍爬取规则")
    private String bookDescPattern;

    @ApiModelProperty(value = "小说作者爬取规则")
    private String bookAuthorPattern;

    @ApiModelProperty(value = "小说名爬取规则")
    private String bookNamePattern;

    @ApiModelProperty(value = "小说状态匹配规则")
    private String bookStatusPattern;

    @ApiModelProperty(value = "查询时，小说列表匹配规则")
    private String searchListGroupPattern;

    @ApiModelProperty(value = "查询时，小说路径匹配规则")
    private String searchHrefPattern;

    @ApiModelProperty(value = "查询时，小说封面匹配规则")
    private String searchImgPattern;

    @ApiModelProperty(value = "查询时，小说名匹配规则")
    private String searchBookNamePattern;

    @ApiModelProperty(value = "查询时，作者名匹配规则")
    private String searchAuthorNamePattern;

    @ApiModelProperty(value = "查询时，小说简介匹配规则")
    private String searchDescPattern;

    @ApiModelProperty(value = "查询时，小说爬取id匹配规则")
    private String searchCrawlBookIdPattern;

    @ApiModelProperty(value = "章节段匹配")
    private String indexPartPattern;

    @ApiModelProperty(value = "匹配需要替换的标签")
    private String replaceLabel;

}
